package com.zz.controller;

import com.zz.pojo.User;
import org.springframework.web.bind.annotation.*;

@RestController
public class TestController {
    /**
    * @Date: 11:05 2021/8/12
    * @Param: [username, password]
    * @return: java.lang.String
    * @Description: 各种请求方式 
    **/

    @GetMapping("test01")
    public String test01(String username,String password){
        System.out.println(username+" "+password);
        return "ok";
    }


    @GetMapping("test02/{username}/{password}")
    public String test02(@PathVariable String username, @PathVariable String password){
        System.out.println(username+" "+password);
        return "ok";
    }

    @PostMapping("test03")
    public String test03(String username , String password){
        System.out.println(username+" "+password);
        return "ok";
    }

    @PostMapping("test04")
    public String test04(String username,String password){
        System.out.println(username+" "+password);
        return "ok";
    }

    @PostMapping("test05")
    public String test05(@RequestBody User user){
        System.out.println(user.getUsername()+" "+user.getPassword());
        return "ok";
    }


}
